/*
 * Copyright (c) 2022 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, Hardware
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef FOUNDATION_GRAPHIC_3D_STANDARD_RENDER_SERVICE_SCENE_VIEW_CORE_H_
#define FOUNDATION_GRAPHIC_3D_STANDARD_RENDER_SERVICE_SCENE_VIEW_CORE_H_

#include "engine_factory.h"

namespace OHOS::Render3D {
using CameraInfo = IEngine::CameraInfo;
using LightInfo = IEngine::LightInfo;
using AnimationState = IEngine::AnimationState;

class SceneViewCore final {
public:
    static SceneViewCore& GetInstance();
    void CreateEngine(EngineFactory::EngineType type, const IPlatformCreateInfo& info);
    TextureInfo CreateTargetSceneTexture(uint32_t key, int32_t width, int32_t height);
    void SetTargetSceneTexture(uint32_t key, const TextureInfo& info);
    void ImportScene(uint32_t key, const std::string& gltfPath);
    void ImportBackgroundScene(uint32_t key, const std::string& gltfPath);
    void SetUpCamera(uint32_t key, const std::string& cameraName, const CameraInfo& info);
    void SetUpLight(uint32_t key, const std::string& lightName, const LightInfo& info);
    void SetUpAnimation(uint32_t key, const std::string& animationName);
    void SetAnimationState(uint32_t key, const std::string& animationName, AnimationState state);
    void RenderFrame(uint32_t key);

private:
    SceneViewCore() = default;
    ~SceneViewCore();
    std::unique_ptr<IEngine> engine_;
};
} // namespace OHOS::Render3D
#endif